package com.agv.core.dao.lectorArchivos;

import org.springframework.jdbc.core.JdbcTemplate;

import com.agv.core.exception.AgvException;

public class TransaccionDosDAOImpl implements ITransaccionDosDAO {

	JdbcTemplate jdbcTemplate;
	
	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	@Override
	public void insertarRegistroBD() throws AgvException {
		StringBuilder builder = new StringBuilder();
		String query;
		
		builder.append("INSERT INTO cxc.t001_cxc_trn_transac(");
		builder.append("	    fh_reserva, id_trn_cxc, moneda_docto )");
		builder.append("    VALUES (?, ?, ?);");
		
		query = builder.toString();
		try {
			jdbcTemplate.update(query, new Object[] {"'2011-11-29'", "nextval('cxc.t001_cxc_trn_transac_seq')","1"});
		} catch (Exception e) {
			System.out.println(e.getMessage());		
		}
	}

}
